﻿using SimpleInjector;
using Sustainalytics.Synchronization.Interface;
using System.Collections.Concurrent;
using System.Collections.Generic;
using Xunit;

namespace Sustainalytics.Governance.Synchronization
{
    [Trait("Category", "Governance")]
    public class GovernanceSyncStepTests
    {
        protected Container SimpleInjectorContainer;
        private readonly GovernanceSync _governanceSync;

        readonly SyncContext _syncContext = new SyncContext()
        {
            GAConnectionStrings = new Dictionary<string, string>
            {
                { "ClientDW", "mongodb://localhost:27017/ClientDW_A" },
                { "GovernanceDW", "mongodb://localhost:27017/GovernanceDW_A" },
                { "GovernanceInputFile", "mongodb://localhost:27017/GovernanceInputFile" },
            },
            Report = new ConcurrentBag<string>()
        };

        public GovernanceSyncStepTests()
        {
            SimpleInjectorContainer =  SimpleInjectorConfig.Register(new SyncContextLogger(_syncContext), _syncContext.GAConnectionStrings);
            _governanceSync = SimpleInjectorContainer.GetInstance<GovernanceSync>();
        }

        [Fact]
        public void Start()
        {
            _governanceSync.Start(_syncContext);
        }
    }
}
